package cn.mymall.util;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        try {
            List<String> strList = FileUtils.readLines(new File("d:\\shandongts.txt"), "utf-8");
            BigDecimal lastBalance = BigDecimal.ZERO;
            for (String s : strList) {
                String[] x = s.split("\t");
                BigDecimal b = new BigDecimal(x[1]).negate().add(new BigDecimal(x[2]));
                if(b.compareTo(lastBalance)!=0){
                    System.out.println(s);
                }
                lastBalance = new BigDecimal(x[2]);
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
